package helloworld.admin.assembler.news;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;

import helloworld.admin.bean.NewsAdminBean;
import helloworld.admin.form.news.NewsForm;

/**
 * @author TUYEN-DM
 *         <p>
 *         2009/05/25
 *         </p>
 *         <p>
 *         NewsFormAssembler is the object to process copyProperties.
 *         </p>
 */
public class NewsFormAssembler {
	private NewsFormAssembler() {
	}

	public static final NewsForm createNewsForm(NewsAdminBean newsDetail) {
		NewsForm form = new NewsForm();
		try {
			BeanUtils.copyProperties(form, newsDetail);
		} catch (InvocationTargetException ite) {
			ite.printStackTrace(); // do nothing for now
		} catch (IllegalAccessException iae) {
			iae.printStackTrace(); // do nothing for now
		}
		return form;
	}
}